package com.khson.knows.portal.controller;


import com.khson.knows.portal.model.Tag;
import com.khson.knows.portal.service.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author com.khson
 * @since 2021-08-23
 */
@RestController
@RequestMapping("/v1/tags")
public class TagController {
    @Autowired
    private ITagService tagService;

    //@GetMapping(""),意思是不添加任何额外路径
    //访问这个控制层方法的路径就是localhost:8080/v1/tags
    @GetMapping("")
    public List<Tag> getTags(){
        return tagService.getTags();
    }
}
